FROM {{ namespace }}/{{ image_prefix }}skyline-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block skyline_apiserver_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

ADD skyline-apiserver-archive /skyline-apiserver-source

{% set skyline_apiserver_pip_packages = [
    '/skyline-apiserver'
] %}

COPY extend_start.sh /usr/local/bin/kolla_skyline_extend_start

RUN ln -s skyline-apiserver-source/* skyline-apiserver \
{# TODO: Remove when https://review.opendev.org/c/openstack/skyline-apiserver/+/935604 is merged #}
    && {{ macros.upper_constraints_remove("aiosqlite") }} \
    && {{ macros.install_pip(skyline_apiserver_pip_packages | customizable("pip_packages")) }} \
    && chmod 644 /usr/local/bin/kolla_skyline_extend_start

{{ macros.kolla_patch_sources() }}

{% block skyline_apiserver_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER skyline
